package com.hfi.abstractfactory.demo01;

/**
 * @author ChangLiang
 * @date 2020/1/16
 */
public class Main {

    public static void main(String[] args) {
        // sql server database
        IDataSourceFactory dataSourceFactory = new SqlServerDataSourceFactory();
        IUser userDao = dataSourceFactory.createUser();
        userDao.createUser();

        // access database
        dataSourceFactory = new AccessDataSourceFactory();
        IDepartment departmentDao = dataSourceFactory.createDepartment();
        departmentDao.createDepartment();
    }
}
